-
-
Notifications
You must be signed in to change notification settings - Fork 437
Make the root package name and path dynamically discovered in MakerTestCase
#1770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.x
Are you sure you want to change the base?
Conversation
MakerTestCaseMakerTestCase
Use Composer\InstalledVersions::getRootPackage() to retrieve the path and name of the root package under test Locate the fixtures and cache directory relatively to this package
| } | ||
|
|
||
| public function runCommand(string $command): MakerTestProcess | ||
| public function runCommand(string|array $command): MakerTestProcess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a breaking change because the class is internal.
| } | ||
|
|
||
| public static function create($commandLine, $cwd, array $envVars = [], $timeout = null): self | ||
| public static function create(string|array $commandLine, string $cwd, array $envVars = [], ?float $timeout = null): self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a breaking change because the class is final and internal
| } | ||
|
|
||
| public function runCommand(string $command): MakerTestProcess | ||
| public function runCommand(string|array $command): MakerTestProcess |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest adding a phpdoc @param string|list<string> $command to document the type of the array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same in MakerTestProcess btw
An issue when using the
MakerTestCaseto test maker classes provided by other packages, is that it depends on thetestsdirectory of thesymfony/maker-bundlepackage.In this PR, we use
Composer\InstalledVersions::getRootPackage()to retrieve the path and name of the root package under test. This way, that's the tested package that is linked into the temporary test projects.This assumes a certain structure of the maker package (
src,testsandtests/fixturesdirs,tests/tmpignored,tools/twigcssubproject).